package com.cd.song.jpa.domain;

import com.cd.common.domain.BaseDomain;
import com.cd.common.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * @Description 歌曲表
 * @Author lqq
 * @Date 2025/5/11 10:51
 **/

@Entity
@Data
@Table(name = "db_song",
        indexes = {
                @Index(name = "idx_title_artist", columnList = "title,artist", unique = true),
                @Index(name = "idx_type", columnList = "type")})
@NoArgsConstructor
@AllArgsConstructor
public class Song extends BaseDomain {

    //id
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    //title 标题
    @Column(name = "title",length = 50)
    private String title;

    //类型 中文 英文 日文 纯音乐
    @Column(name = "type",length = 10)
    private String type;

    //作者
    @Column(name = "artist",length = 50)
    private String artist;

    //歌曲年份 还没想好
//    @Column(name = "create_time")
//    private String createTime;

    //创建人 方便扩展
    @Column(name = "user_id")
    private Long userId;

    @Transient
    private String tags;
}
